from PIL import Image, ImageDraw
import os

def create_icon():
    # 创建一个 22x22 的透明背景图像
    image = Image.new('RGBA', (22, 22), color=(0, 0, 0, 0))
    dc = ImageDraw.Draw(image)
    
    # 绘制图标
    # 外圈
    dc.ellipse([2, 2, 20, 20], outline='blue', width=2)
    # 内圈
    dc.ellipse([6, 6, 16, 16], fill='blue')
    
    # 确保目标目录存在
    icon_path = os.path.join('ws_notifier', 'gui', 'assets')
    os.makedirs(icon_path, exist_ok=True)
    
    # 保存图标
    icon_file = os.path.join(icon_path, 'icon.png')
    image.save(icon_file, 'PNG')
    print(f"Created icon at: {icon_file}")

if __name__ == '__main__':
    create_icon() 